package sg.edu.nus.iss.phoenix.dao;

import java.sql.Connection;
import java.sql.SQLException;

import sg.edu.nus.iss.phoenix.schedule.dao.AnnualScheduleDAO;
import sg.edu.nus.iss.phoenix.schedule.dao.ProgramSlotDAO;
import sg.edu.nus.iss.phoenix.schedule.dao.WeeklyScheduleDAO;
import sg.edu.nus.iss.phoenix.authenticate.dao.RoleDao;
import sg.edu.nus.iss.phoenix.authenticate.dao.UserDao;
import sg.edu.nus.iss.phoenix.presenterproducer.dao.PresenterProducerDAO;
import sg.edu.nus.iss.phoenix.presenterproducer.dao.PresenterDAO;
import sg.edu.nus.iss.phoenix.presenterproducer.dao.ProducerDAO;
import sg.edu.nus.iss.phoenix.authenticate.dao.impl.RoleDaoImpl;
import sg.edu.nus.iss.phoenix.authenticate.dao.impl.UserDaoImpl;
import sg.edu.nus.iss.phoenix.radioprogram.dao.RadioProgramDAO;
import sg.edu.nus.iss.phoenix.schedule.dao.impl.AnnualScheduleDAOImpl;
import sg.edu.nus.iss.phoenix.schedule.dao.impl.ProgramSlotDAOImpl;
import sg.edu.nus.iss.phoenix.schedule.dao.impl.WeeklyScheduleDAOImpl;
import sg.edu.nus.iss.phoenix.users.dao.UserRoleDAO;
import sg.edu.nus.iss.phoenix.users.dao.impl.UserRoleDAOImpl;
import sg.edu.nus.iss.phoenix.radioprogram.dao.impl.RadioProgramDAOImpl;
import sg.edu.nus.iss.phoenix.presenterproducer.dao.impl.PresenterProducerDAOImpl;
import sg.edu.nus.iss.phoenix.presenterproducer.dao.impl.PresenterDAOImpl;
import sg.edu.nus.iss.phoenix.presenterproducer.dao.impl.ProducerDAOImpl;




/**
 * @author Shangar
 *
 */
public class DAOFactory {
	private AnnualScheduleDAO annualScheduleDAO;
	private WeeklyScheduleDAO weeklyScheduleDAO;
	private ProgramSlotDAO programSlotDAO;
	private RadioProgramDAO radioProgramDAO;
	private UserDaoImpl userDAO;
	private UserRoleDAOImpl userroleDAO;
	private RoleDaoImpl roleDAO;
	private PresenterProducerDAO presenterProducerDAO;
	private PresenterDAO presenterDAO;
	private ProducerDAO producerDAO;
	
	public RoleDao getRoleDAO() {
		return roleDAO;
	}

	public DAOFactory(){

		annualScheduleDAO = new AnnualScheduleDAOImpl();
		weeklyScheduleDAO = new WeeklyScheduleDAOImpl();
		programSlotDAO = new ProgramSlotDAOImpl();
		radioProgramDAO = new RadioProgramDAOImpl();
		userDAO= new UserDaoImpl();
		roleDAO = new RoleDaoImpl();
		userroleDAO = new UserRoleDAOImpl();
		presenterProducerDAO = new PresenterProducerDAOImpl();
		presenterDAO = new PresenterDAOImpl();
		producerDAO = new ProducerDAOImpl();
	}

	public UserRoleDAO getUserroleDAO() {
		return userroleDAO;
	}


	public AnnualScheduleDAO getAnnualScheduleDAO() {
		return annualScheduleDAO;
	}

	public WeeklyScheduleDAO getWeeklyScheduleDAO() {
		return weeklyScheduleDAO;
	}

	public ProgramSlotDAO getProgramSlotDAO() {
		return programSlotDAO;
	}
	
	public RadioProgramDAO getRadioProgramDAO() {
		return radioProgramDAO;
	}
	
	public UserDao getUserDAO() {
		return userDAO;
	}
	
	public PresenterProducerDAO getPresenterProducerDAO() {
		return presenterProducerDAO;
	}
	
	public PresenterDAO getPresenterDAO() {
		return presenterDAO;
	}
	
	public ProducerDAO getProducerDAO() {
		return producerDAO;
	}
	
	private Connection getDBConnection() {
		try{
			DBConnection connection = new DBConnection();
			Connection c = connection.getDBConnection();
			return c;
		}
		catch (SQLException e) {
			e.printStackTrace();
			return null;
		}
	}
	
}
	